﻿<Window x:Class="AppReviewerClient.AvailableExerciseView"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:cal="http://www.caliburnproject.org"
        xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit" Title="{Binding Path=AvailableExerciseViewTitle}" Height="300" Width="800"
        WindowStartupLocation="CenterScreen">
    <xctk:BusyIndicator IsBusy="{Binding Path=IsWaiting}">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="200*" />
            </Grid.RowDefinitions>
            <DockPanel >
                <Button x:Name="UpdateListCmd" Width="60" >
                    <StackPanel>
                        <Image Source="images/update.png"  />
                    </StackPanel>
                </Button>
                <TextBlock Text="{Binding Path=ActionText}" DockPanel.Dock="Left" MinWidth="220" VerticalAlignment="Center" FontSize="30" />
                <ProgressBar Minimum="0" Maximum="100" Value="{Binding Path=DownloadProgress}" Height="50" />
            </DockPanel>
            <ListView ItemsSource="{Binding Path=Exercises}" Grid.RowSpan="1" Grid.Row="1">
                <ListView.Background>
                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                        <GradientStop Color="#FFF6F8A9" Offset="0.936" />
                        <GradientStop Color="#FFFDFFE2" Offset="0.076" />
                        <GradientStop Color="#FFFFFFD4" Offset="0.419" />
                    </LinearGradientBrush>
                </ListView.Background>
                <ListView.View>
                    <GridView>
                        <GridViewColumn Width="130">
                            <GridViewColumn.CellTemplate>
                                <DataTemplate>
                                    <Button cal:Message.Attach="[Event Click] = [Action OpenElement($this)]">Start</Button>
                                </DataTemplate>
                            </GridViewColumn.CellTemplate>

                        </GridViewColumn>

                        <GridViewColumn Header="Title" DisplayMemberBinding="{Binding Path=Title}" Width="150">

                        </GridViewColumn>

                        <GridViewColumn Header="Author" DisplayMemberBinding="{Binding Path=Author}" Width="150">

                        </GridViewColumn>
                        <GridViewColumn Header="Reward" DisplayMemberBinding="{Binding Path=Reward}"  Width="80">

                        </GridViewColumn>
                        <GridViewColumn Header="Date" DisplayMemberBinding="{Binding Path=Date}"  Width="100">

                        </GridViewColumn>
                        <GridViewColumn Header="Stautus" DisplayMemberBinding="{Binding Path=LocalExerciseStatus}"  Width="100">

                        </GridViewColumn>


                    </GridView>
                </ListView.View>
            </ListView>
        </Grid>
    </xctk:BusyIndicator>
</Window>

    